home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / fastwe1a / modwebpa.bas < prev    next >
BASIC Source File  |  1999-10-19  |  3KB  |  92 lines

  1. Attribute VB_Name = "modWebPack"
  2. '*******************
  3. '* By Jared Conway *
  4. '* October 19,  99 *
  5. '* Written for fun *
  6. '* and my own use. *
  7. '*******************
  8.  
  9. 'WARNING! This code is distributed FOR FREE on the internet and
  10. 'is not to be sold or used for any other form of monetary gain!
  11. 'It is made for educational purposes ONLY! You can get the most
  12. 'recent version of this program and source code and many other
  13. 'programs I have made at members.home.net/jared2k
  14.  
  15. 'THINGS STILL TO BE ADDED
  16. 'Offline browsing, scheduling automatic browsing with TaskScheduler,
  17. 'skinning and user controlled color changing, AutoFill for addresses,
  18. 'site filtering (for adult content), tips, online help, ability
  19. 'to add favorites while at the site with one click
  20.  
  21. 'structure used to handle favorites
  22. Type cFavorite
  23.     URL As String * 50
  24.     Title As String * 12
  25. End Type
  26.  
  27. 'structure used to handle options
  28. Type cOptions
  29.     StartURL As String * 50  'starting url when browser launched
  30.     Home1URL As String * 50  'left click home site
  31.     Home2URL As String * 50  'right click home site
  32.     SearchURL As String * 50 'search url
  33.     ShowPaths As Integer     'display path in address bar? 1 yes, 0 no
  34. End Type
  35.  
  36. Global bHasOptionsChanged As Boolean 'used if options have changed
  37. Global bHasChanged As Boolean 'used if favorites have changed
  38. Global Options As cOptions 'global instance of options
  39. Global Fav As cFavorite 'global instance of favorites
  40. Public Sub gRefreshOptions()
  41.     'open the options file and load them into memory
  42.     Open App.Path & "\options.web" For Random As #1 Len = Len(Options)
  43.         Get #1, 1, Options
  44.     Close #1
  45.     
  46.     'display the options we loaded on the screen
  47.     If RTrim(Options.StartURL) = "-" Then RTrim(Options.StartURL) = ""
  48.     frmOptions.txtStartingURL.Text = RTrim(Options.StartURL)
  49.     frmOptions.txtHome1URL.Text = RTrim(Options.Home1URL)
  50.     frmOptions.txtHome2URL.Text = RTrim(Options.Home2URL)
  51.     frmOptions.txtSearchURL.Text = RTrim(Options.SearchURL)
  52.     If Options.ShowPaths = 1 Then
  53.         frmOptions.chkShowPaths.Value = 1
  54.     Else
  55.         frmOptions.chkShowPaths.Value = 0
  56.     End If
  57.     'set options to not have changed (filling in the above would
  58.     'trick the timer into enabling the save button even though
  59.     'it should not be enabled
  60.     bHasOptionsChanged = False
  61. End Sub
  62. Public Sub gLoadFavorites()
  63.     'open the favorites file and display them to the screen
  64.     Open App.Path & "\favorites.web" For Random As #1 Len = Len(Fav)
  65.     For X = 1 To 10
  66.         Get #1, X, Fav
  67.         frmMain.lblLink1(X - 1).Caption = RTrim(Fav.Title)
  68.     Next X
  69.     Close #1
  70. End Sub
  71.  
  72. Public Sub gRefreshFavorites()
  73.     'open favorites file and load them on the screen
  74.     Open App.Path & "\favorites.web" For Random As #1 Len = Len(Fav)
  75.     For X = 1 To 10
  76.         Get #1, X, Fav
  77.         frmFav.txtLink(X - 1).Text = RTrim(Fav.URL)
  78.         frmFav.txtTitle(X - 1).Text = RTrim(Fav.Title)
  79.     Next X
  80.     Close #1
  81.     
  82.     'set changed to false
  83.     bHasChanged = False
  84.     'disable the save button until something changes
  85.     frmFav.cmdSave.Enabled = False
  86. End Sub
  87.  
  88. Public Sub errHandler()
  89.     'global error handler that prevents the browser from crashes
  90.     Exit Sub
  91. End Sub
  92.